<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" crossorigin="anonymous">
  <script src="../js/jquery.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
  <style>
    .row {
      background-color: turquoise;
      height: 100px;
    }
    .box {
      background-color: white;
      height: 50px;
      border: 1px solid black;
    }
  </style>
  <script>
    $(function() {
      $('#btnOpen').click(function() {
        $('#modal').modal('show')
      })
    })
  </script>
</head>
<body>
  <button id="btnOpen" type="button" class="btn btn-primary">打开模态框</button>
  <div class="row">
    <div class="col-3 box"></div>
    <div class="col-6 box"></div>
    <div class="col-3 box"></div>
  </div>
  <!-- 模态框 -->
  <div class="modal fade" id="modal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          ...
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
          <button type="button" class="btn btn-primary">Save changes</button>
        </div>
      </div>
    </div>
  </div>
</body>
</html>